package example;

import java.util.Scanner;

public class Client  {
    public static void main(String[] args) {
        /** 点一份炒饭 **/
        FastFood friedRice=new FriedRice(8,"炒饭");
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入您想要的配料：");

        System.out.println("1、鸡蛋(一份两元)    2、豆腐(一份三元)");
        int n = scanner.nextInt();
        if (n==1){
            System.out.println("请输入数量：");
            int m=scanner.nextInt();
            for (int i=1;i<=m;i++){
                friedRice=new Egg(2,"鸡蛋",friedRice);
                dealDetail(3,"豆腐",m,friedRice);
            }
        }else if(n==2){
            System.out.println("请输入数量：");
            int m=scanner.nextInt();
            dealDetail(3,"豆腐",m,friedRice);
        }else {
            System.out.println("暂时无此配料");
        }
        System.out.println("最后的总价为："+friedRice.cost());
    }

    private static void dealDetail(double price,String desc,int m,FastFood friedRice){
        for (int i=1;i<=m;i++){
            friedRice=new Egg(3,"豆腐",friedRice);
            friedRice.cost();
        }
    }
}
